<!-- eslint-disable vue/valid-v-for -->
<!-- 关联车辆 -->
<template>
  <a-modal v-model:visible="showModal" :mask-closable="false" title="催缴" width="45vw" unmount-on-close @close="onClose">
    <a-table :columns="columns" :data="data" />
    <template #footer>
      <a-button @click="onClose">关闭</a-button>
    </template>
  </a-modal>
</template>

<script setup>
  import { ref, onMounted } from 'vue'
  import { checkCallRecord } from '@/api/asset/carViolation'

  const showModal = ref(false)
  const data = ref([])

  const columns = [
    {
      title: '催缴状态',
      dataIndex: 'urgeFeeStatusName',
      render: () => {
        return '已催缴'
      },
      width: 100,
    },
    {
      title: '操作人',
      dataIndex: 'createUserName',
      width: 100,
    },
    {
      title: '时间',
      dataIndex: 'createTime',
      width: 180,
    },
    {
      title: '催缴说明',
      dataIndex: 'description',
    },
  ]
  const show = (e) => {
    console.log(e)
    showModal.value = true
    if (e) {
      getList(e)
    }
  }

  const onClose = () => {
    showModal.value = false
    data.value = []
  }

  const getList = (e) => {
    checkCallRecord({ id: e }).then((res) => {
      if (res.code == 200) {
        data.value = res.result.urgeList
      }
    })
  }
  const onConfirm = () => {
    showModal.value = false
    data.value = []
  }

  defineExpose({
    show,
  })

  onMounted(() => {})
</script>

<style lang="less" scoped>
  .page-form {
    margin: 0;
    height: 300px;
    // padding: 0 60px;
    :deep(.arco-row) {
      margin-left: 0 !important;
      margin-right: 0 !important;
    }
    :deep(.arco-modal-body) {
      padding: 10px 80px !important;
    }
    :deep(.arco-col) {
      padding: 0 10px !important;
    }
  }
  .typeName {
    margin-bottom: 20px;
  }
  .typeNameLabel {
    font-size: 14px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #4e5969;
    line-height: 22px;
    text-align: left;
  }
  .typeNameValue {
    font-size: 14px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #1d2129;
  }
</style>
